/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/menubar_in_main_toolbar.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */

#navigator-toolbox{
  display: grid;
  grid-template-columns: auto 1fr;
}
.browser-toolbar{
  grid-column: 1/3;
}
#toolbar-menubar{
  grid-column: 1/2;
  grid-row: 2/3;
  border-top: 0.01px var(--tabs-navbar-separator-style) var(--tabs-navbar-separator-color) !important;
  background-color: var(--toolbar-bgcolor) !important;
  color: var(--toolbar-color);
  opacity: 1 !important;
}
#nav-bar{
  grid-column: 2/3;
}
#main-menubar{
  flex: 1;
}
#toolbar-menubar:is([autohide=""],[autohide="true"]):is([inactive=""],[inactive="true"]){
  max-width: 0px !important;
}
#toolbar-menubar > .titlebar-buttonbox-container{ display: none }
:root[customtitlebar] #TabsToolbar > .titlebar-buttonbox-container{
  display: flex !important;
}
:root[customtitlebar][sizemode="normal"] #TabsToolbar > .titlebar-spacer{
  display: flex !important;
}
@media -moz-pref("userchrome.menubar-in-main-toolbar.tabs-on-bottom.enabled"){
  #nav-bar,#toolbar-menubar{
    grid-row: 1/2;
  }
  #TabsToolbar{
    order: 2;
  }
  #TabsToolbar#TabsToolbar > :is(.titlebar-buttonbox-container,.titlebar-spacer){
    display: none !important;
  }
  :root[customtitlebar] #nav-bar > :is(.titlebar-spacer[type="post-tabs"],.titlebar-buttonbox-container){
    display: flex !important;
  }
}